﻿namespace FrameWorkSong
{
    public class ResFactory 
    {
        public static Res Create(string assetName, string assetPath, string ownerBundel = null)
        {
            Res res = null;
            if (ownerBundel != null)
            {
                res = new AssetRes(assetName, ownerBundel, assetPath);
            }
            else if (assetPath.StartsWith("resources://"))
            {
                res = new ResourcesRes(assetName, assetPath);
            }
            else
            {
                res = new AssetBundleRes(assetName, assetPath);
            }
            return res;
        }
    }
}